<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html:html>
<head>
<title>Add Book Source</title>
<link rel="stylesheet" href="<%=request.getContextPath() %>/default.css" type="text/css">
<html:base/>
</head>

<body>

<div id="header">
	<div id="logo">
		<h1>
			<html:img width="40" src="../images/EMPTY.GIF"/>
			<html:link page="/pages/home.jsp">Textbook Crossroads</html:link>
		</h1>
		<h2>Team 14 - LoneTree</h2>
	</div>
	<div id="menu">
		<ul>
			<li><html:link action="/PrepForMyBooks">Dashboard</html:link></li>
			<li class="active"><html:link page="/pages/books.jsp">Books</html:link></li>
			<li><html:link page="/pages/courses.jsp">Courses</html:link></li>
			<li><html:link page="/pages/about.jsp">About</html:link></li>
			<li class="logon"><html:link action="/logout">LogOut</html:link></li> 
		</ul>
	</div>
</div>

<logic:notPresent name="org.apache.struts.action.MESSAGE" scope="application">
  <font color="red">
    ERROR:  Application resources not loaded -- check servlet container
    logs for error messages.
  </font>
</logic:notPresent>

<div id="content">

	<div id="sidebar">
			<div id="categories">
			<div id="archives" class="boxed">
				<h2>MyActions</h2>
				<div class="content">
					<ul>
			    		<li><html:link page="/PrepForMyBooks.do?manage=books">Manage MyBooks</html:link></li>
			            <li><html:link page="/PrepForMyBooks.do?manage=sections">Manage MySections</html:link></li>
					</ul>
				</div>
			</div>
		</div>
	</div>

	<html:form action="/CommitSource" focus="name" onsubmit="return validateLogonForm(this);" >
	<html:hidden value="<%=(String)request.getAttribute("isbn") %>" property="isbn"  />
	<div id="posts">
		<div class="post">
			<h2 class="title">Add Book Source</h2>
			
			<div class="meta">
				<p class="date">Source for Book:</p>
			</div>
			<div class="story">
			<p>
				<logic:present name="book">
				<bean:write name="book" property="title" />
				</logic:present>
				
				<logic:notPresent name="book">
				<i>No book selected.</i>
				</logic:notPresent>
			</p>
			</div>
			
			<logic:present name="book">
			
				<div class="meta">
					<p class="date">Source Type:</p>
				</div>
				<div class="story">
				<p>
					<html:radio property="type" value="user" />&nbsp;&nbsp;Myself<br>
					<html:radio property="type" value="physical" />&nbsp;&nbsp;Physical Retailer<br>
					<html:radio property="type" value="online" />&nbsp;&nbsp;Online Retailer
				</p>
				</div>
				
				<div class="meta">
					<p class="date">Source Details:</p>
				</div>
				<div class="story">
				<p>
				
				<strong>Source name (leave blank if you are the seller/source):</strong><br>
				<html:text property="name" />
				
				<br/><br/>
				
				<strong>Source location:</strong><br>
				If you are the seller/source, leave blank<br>
				If the source is a physical retailer, enter a physical address<br>
				If the source is an electronic/online retailer, enter a URL<br>
				<html:text property="location" />
				
				<br/><br/>
				
				<strong>Price:</strong><br>
				$&nbsp;<html:text property="price" size="6" maxlength="6"/>
				
				<br/><br/>
				
				<strong>Description:</strong><br>
				<html:textarea property="description" cols="50" rows="10" />
				
				<br/>
				
				<html:submit>Save source</html:submit>
				<html:reset><bean:message key="clear.button" /></html:reset>
				
				</p>
				</div>
			
			</logic:present>
		</div>
	</div>
	</html:form>
	
</div>

<!-- FOOTER -->

<div id="footer">
	<p id="copy">&copy;2007 LoneTree.</p>
	<p> (Andrew Lee | Bojan Martin | Dimeji Omikunle | Minghui Yu)</p>
</div>
</body>
</html:html>
